﻿-- =============================================
-- Author:		<顾世杰>
-- Create date: <2013-11-08>
-- Description:	<批量设置百度维护客服>
-- =============================================
CREATE PROCEDURE [dbo].[proc_BDProject_BatUpdate_TrackKf] 
(
	@Order_Id varchar(4000),--客户表中GUID
	@TrackKfAccount varchar(20),
	@TrackKfName nvarchar(50),	
	@CompanyId int
)
AS
BEGIN
Declare @cSql varchar(4000)
Set @cSql='

--更改客户表
update customer set BDServiceperson='''+@TrackKfAccount+''',
					BDServicepersonEName='''+@TrackKfName+''',BDServiceDate=getdate()
					where companyid='+Convert(varchar,@CompanyId)+'  and customerid in ('+@Order_Id+') 
                
--更改成单表 百度                
 update [Order] set trackBDAccount='''+@TrackKfAccount+''',trackBDName='''+@TrackKfName+'''
     where cusid in ('+@Order_Id+')  and companyid='+Convert(varchar,@CompanyId)+'
     
'

exec(@cSql)                
               
 
END
